#!/bin/bash

echo "启动设备维修工作流系统前端..."

# 检查是否安装了Node.js
if ! command -v node &> /dev/null; then
    echo "错误: 未找到Node.js，请先安装Node.js 18+"
    echo "下载地址: https://nodejs.org/"
    exit 1
fi

# 检查是否安装了npm
if ! command -v npm &> /dev/null; then
    echo "错误: 未找到npm"
    exit 1
fi

# 进入前端目录
cd device-repair-frontend

echo "安装依赖..."
npm install

echo "启动开发服务器..."
echo "前端将在 http://localhost:4200 启动"
echo ""
echo "按 Ctrl+C 停止应用"

npm start 